package cn.dkk.create_design.prototype.deep_clone_prototype;

import cn.dkk.create_design.prototype.projo.Student;

import java.io.Serializable;

/**
 * 深克隆原型模式
 */
public class DeepClonePrototype implements Cloneable, Serializable {

    private Student student;

    protected DeepClonePrototype clone() {
        try {
            return DeepCloneUtils.deepClone(this);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public String toString() {
        return student.getStudentName()+"获奖";
    }

    public DeepClonePrototype(Student student) {
        this.student = student;
    }

    public Student getStudent() {
        return student;
    }

    public void setStudent(Student student) {
        this.student = student;
    }
}
